package com.bsoft.gol.editor.model;


import com.bsoft.gol.editor.editor.ImportLog;

public class ImportResult {

	private int total = 0;//总条数
	private int succesCount = 0;//成功的条数
	private int failCount = 0;//失败的条数
	private ImportLog log;//导入操作的日志
	private long takeMs = 0;//花费的时间毫秒数
	private int taskCount;//任务个数
	private Object summary;//综合信息
	
	public void setTotal(int total){
		this.total = total;
	}
	public int getTotal(){
		return this.total;
	}
	public int getSuccesCount(){
		return this.succesCount;
	}
	
	public void setSuccesCount(int succesCount){
		this.succesCount = succesCount;
	}
	
	/**
	 * 总耗时设置[多线程任务中使用]
	 * @param takeMs 总耗时
	 * @param lock 对象锁
	 */
	public void setTakeMs(int takeMs,Object lock){
		synchronized(lock){
			this.takeMs += takeMs;
		}
	}
	
	/**
	 * 成功记录总数设置[多线程任务中使用]
	 * @param succesCount 成功的记录总数
	 * @param lock 对象锁
	 */
	public void setSuccesCount(int succesCount,Object lock){
		synchronized(lock){
			this.succesCount += succesCount;
		}
	}
	
	/**
	 * 失败记录总数设置[多线程任务中使用]
	 * @param failCount 失败记录总数
	 * @param lock 对象锁
	 */
	public void setFailCount(int failCount,Object lock){
		synchronized(lock){
			this.failCount += failCount;
		}
	}

	
	/**
	 * 总数设置[多线程任务中使用]
	 * @param total 总数
	 * @param lock 对象锁
	 */
	public void setTotal(int total,Object lock){
		synchronized(lock){
			this.total += total;
		}
	}
	
	public int getFailCount(){
		return this.failCount;
	}
	
	public void setFailCount(int failCount){
		this.failCount = failCount;
	}
	public long getTakeMs(){
		return this.takeMs;
	}
	
	public void setTakeMs(long takeMs){
		this.takeMs = takeMs;
	}
	public Object getSummary(){
		return this.summary;
	}
	
	public void setSummary(Object summary){
		this.summary = summary;
	}

	public int getTaskCount() {
		return taskCount;
	}

	public void setTaskCount(int taskCount) {
		this.taskCount = taskCount;
	}
	public ImportLog getLog() {
		return log;
	}
	public void setLog(ImportLog log) {
		this.log = log;
	}

}
